/**
 * Created by hanxiaoqiang on 16/7/4.
 */

(function ($) {
    $.isBlank = function (obj) {
        return (!obj || $.trim(obj) === "");
    };
})(jQuery);

/**
 * 错误提示框
 *
 * message: 错误提示框
 */
(function ($) {
    $.error = function (message) {
        $.gritter.add({
            title: '错误:',
            text: message,
        });
        return false;
    };
})(jQuery);

/**
 * 成功提示框
 * message: 成功提示框
 */
(function ($) {
    $.success = function (message) {
        $.gritter.add({
            title: '成功:',
            text: message,
            class_name: 'gritter-light'
        });
    };
})(jQuery);


function errorMsg(id) {
    var message = $('#' + id).val();

    if (!$.isBlank(message)) {
        $.error(message);
    }

}

function successMsg(id) {
    var success = $('#' + id).val();
    if (!$.isBlank(message)) {
        $.error(message);
    }
}